# -*- coding: utf-8 -*-
import re
if __name__ == '__main__':
    s = "Max Speed (X1000 rpm)"
    key = s.replace('（', '(').replace('）', ')')
    match = re.search(r'\((.*?)\)', key)
    if match:
        unit = match.group(1)
    else:
        unit = ''
    key = key.replace('(' + unit + ')', '').strip().replace(' ', '_').lower()
    print(key)